package Chapter11;

/**
 * @author 杨森
 * @date 2022年10月20日 15:22
 */
public class EnumExercise02 {
    public static void main(String[] args) {
        Week[] value = Week.values();
        System.out.println("=====所有星期的信息如下=====");
        for (Week week : value) {
            System.out.println(week);
        }

    }
}

enum Week {
//    枚举
    MONDAY("星期一"), TUESDAY("星期二"), WEDNESDAY("星期三"), THURSDAY("星球四"), FRIDAY("星期五"), SATURDAY("星期六"), SUNDAY("星期日");
    private final String name;

    private Week(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Week{");
        sb.append("name='").append(name).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
